Dear all, I got the following function below which returns true if the object has an embedded ole in it. I'm interessted only in EmbeddedOleObject ole and i want to know if it's possible to convert that EmbeddedOleObject to a string with richText, cause i want to know which information get's send to the clipboard. Thank you very much. bool textHasOLE (Object o, string &label) { RichText rtf bool itHas = false EmbeddedOleObject ole string s = richTextWithOle o."Object Text" string textLine label = ""
for rtf in s do { if (rtf.isOle) { ole = rtf.getEmbeddedOle oleCopy (ole) /// That's the part im interessted in itHas = true } else { textLine = o."Object Text" //rtf.text if ((isTable textLine) or (isFigure textLine)) label = textLine [start 0:] } }
return itHas }
meiju011 - Tue Jun 24 09:12:24 EDT 2014 |
Re: Possible to get EmbeddedOleObject as a string? Looking at the DOORS perms XLS doing a quick filter for all functions operating on EmbeddedOleObject I find the following two functions which should do what you want:
Buffer oleRtf (EmbeddedOleObject, Buffer&) // since DOORS 9.3 string oleRtf (EmbeddedOleObject) As long as you do not need to maintain backward compatibility you should always use the 1st one because putting OLEs to the string table is kind of a no-no for scripts that do not want to die of memory. In case you need to maintain backward compatibilty you should put some code in place to use the Buffer version when you have DOORS 9.3+ and only use the older one if not.
Regards, Mathias |
Re: Possible to get EmbeddedOleObject as a string? Hi Mathias, thank you very much for the explanation. It seems to work fine for me.
Regards, Julian |